package come.tool.FightingEffect;

import java.util.ArrayList;
import java.util.List;

import org.come.bean.PathPoint;

import com.tool.tcp.GetTcpPath;
import com.tool.tcp.NewPart;
import com.tool.tcp.SpriteFactory;

import come.tool.Fighting.FightingMixDeal;
import come.tool.Fighting.FightingMove2;
import come.tool.Fighting.FightingState;
import come.tool.Fighting.Fightingimage;
import come.tool.Fighting.ShadowMode;
import come.tool.Fighting.SkillSpell;
import come.tool.Fighting.StateProgress;

public class AttackEffect implements Effect{
//	攻击9 防御 6 被攻击4 法术5 
	@Override
	public StateProgress analysisAction(FightingState State, int path) {
		// TODO Auto-generated method stub
		 StateProgress  progress=EffectType.getProgress(State, path);
		 progress.setMan(path);
		 Fightingimage fightingimage=FightingMixDeal.CurrentData.get(path);
		 if ("普通攻击".equals(State.getStartState())) {
			 int dir=Integer.parseInt(State.getEndState());
			 dir=EffectType.getdir(dir,State.getCamp()==FightingMixDeal.camp?FightingMixDeal.camp:State.getCamp());
			 progress.setDir(dir);
			 progress.setDirend(dir);
			 progress.setType(9);
		 }else  if ("法术攻击".equals(State.getStartState())){
			 progress.setType(5);
		 }else  if ("防御".equals(State.getStartState())){
//			 SkillSpell skillSpell=new SkillSpell();
//			 skillSpell=new SkillSpell(GetTcpPath.getSkillTcp("防御"),fightingimage.getX(),fightingimage.getY());
//			 progress.setSpell(skillSpell);
			 progress.setType(6);
		 }else  if ("被攻击".equals(State.getStartState())){
			progress.setType(4);
		 }else  if ("技能".equals(State.getStartState())){
			 if (progress.getHp_Change()<0) {
				 progress.setType(4);
			}else {
				 progress.setType(7);	
			}	
		 }else  if ("药".equals(State.getStartState())){
			 if (progress.getHp_Change()>0||progress.getMp_Change()>0) {
				 progress.setMusic("药品");
				 SkillSpell skillSpell=new SkillSpell();
				 skillSpell=new SkillSpell(progress.getHp_Change()>0?GetTcpPath.getSkillTcp("加血"):GetTcpPath.getSkillTcp("加蓝"),fightingimage.getX(),fightingimage.getY());
				 progress.setSpell(skillSpell);				 
			 } 
			 progress.setType(7);		
		 }else  if ("代价".equals(State.getStartState())){
			 progress.setType(0);		
		 }else  if ("限制刷新".equals(State.getStartState())){
			progress.setType(0);
			fightingimage.getFightingManData().setState_1(State.getEndState());
			//刷新技能栏
			if (fightingimage.getFightingManData().getCamp() == FightingMixDeal.camp && fightingimage.getFightingManData().getMan() == FightingMixDeal.myman()) {
				FightingMixDeal.buffUtil.SXSkill(fightingimage.getFightingManData().cxxx("技能"));	
			}			
		 }else if ("特效1".equals(State.getStartState())) {
			 progress.setType(3);
		 }else if ("特效2".equals(State.getStartState())) {
			 progress.setType(11);
		 }else if ("特效3".equals(State.getStartState())) {
			 progress.setType(12);
		 }
		 return progress;
	}

}
